package com.ruoyi.net.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.domain.BusiMtnChannelConstraint;
import com.ruoyi.net.mapper.BusiMtnChannelConstraintMapper;
import com.ruoyi.net.service.IBusiMtnChannelConstraintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务-MTN Channel-路由约束配置Service业务层处理
 * 
 * @author tony
 * @date 2024-12-09
 */
@Service
public class BusiMtnChannelConstraintServiceImpl implements IBusiMtnChannelConstraintService 
{
    @Autowired
    private BusiMtnChannelConstraintMapper busiMtnChannelConstraintMapper;

    /**
     * 查询业务-MTN Channel-路由约束配置
     * 
     * @param id 业务-MTN Channel-路由约束配置主键
     * @return 业务-MTN Channel-路由约束配置
     */
    @Override
    public BusiMtnChannelConstraint selectBusiMtnChannelConstraintById(String id)
    {
        return busiMtnChannelConstraintMapper.selectBusiMtnChannelConstraintById(id);
    }

    /**
     * 查询业务-MTN Channel-路由约束配置列表
     * 
     * @param busiMtnChannelConstraint 业务-MTN Channel-路由约束配置
     * @return 业务-MTN Channel-路由约束配置
     */
    @Override
    public List<BusiMtnChannelConstraint> selectBusiMtnChannelConstraintList(BusiMtnChannelConstraint busiMtnChannelConstraint)
    {
        return busiMtnChannelConstraintMapper.selectBusiMtnChannelConstraintList(busiMtnChannelConstraint);
    }

    /**
     * 新增业务-MTN Channel-路由约束配置
     * 
     * @param busiMtnChannelConstraint 业务-MTN Channel-路由约束配置
     * @return 结果
     */
    @Override
    public int insertBusiMtnChannelConstraint(BusiMtnChannelConstraint busiMtnChannelConstraint)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiMtnChannelConstraint.getId())) {
            busiMtnChannelConstraint.setId(uuid);
        }
        busiMtnChannelConstraint.setCreateBy(SecurityUtils.getUsername());
        busiMtnChannelConstraint.setCreateTime(DateUtils.getNowDate());
        busiMtnChannelConstraint.setUpdateBy(SecurityUtils.getUsername());
        busiMtnChannelConstraint.setUpdateTime(DateUtils.getNowDate());
        return busiMtnChannelConstraintMapper.insertBusiMtnChannelConstraint(busiMtnChannelConstraint);
    }

    /**
     * 修改业务-MTN Channel-路由约束配置
     * 
     * @param busiMtnChannelConstraint 业务-MTN Channel-路由约束配置
     * @return 结果
     */
    @Override
    public int updateBusiMtnChannelConstraint(BusiMtnChannelConstraint busiMtnChannelConstraint)
    {
        busiMtnChannelConstraint.setUpdateBy(SecurityUtils.getUsername());
        busiMtnChannelConstraint.setUpdateTime(DateUtils.getNowDate());
        return busiMtnChannelConstraintMapper.updateBusiMtnChannelConstraint(busiMtnChannelConstraint);
    }

    /**
     * 批量删除业务-MTN Channel-路由约束配置
     * 
     * @param ids 需要删除的业务-MTN Channel-路由约束配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiMtnChannelConstraintByIds(String[] ids)
    {
        return busiMtnChannelConstraintMapper.deleteBusiMtnChannelConstraintByIds(ids);
    }

    /**
     * 删除业务-MTN Channel-路由约束配置信息
     * 
     * @param id 业务-MTN Channel-路由约束配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiMtnChannelConstraintById(String id)
    {
        return busiMtnChannelConstraintMapper.deleteBusiMtnChannelConstraintById(id);
    }
}
